<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        p{width:100%;float: left;margin: 0;}
        p>span{width: 200px;float: left;}
    </style>
</head>
<body>
    <div id="app">
        {{myName}}
        <input type="text" v-model="myName">
        <p><span>变量</span><span>{{message}}</span></p>
        <p><span>表达式</span><span>{{10+5}}</span></p>
        <p><span>三目运算符</span><span>{{message.length>3?'正确':'正确'}}</span></p>
        <p><span>函数</span><span>{{getNum()}}</span></p>
        <!-- 立即执行函数的写法 -->
        <p><span>函数匿名</span><span>{{((x)=>x+100)(20)}}</span></p>
        <!-- 使用对象做插值时，对象与插值符号之间要有空格 -->
        <p><span>对象</span><span>{{ {'age':18} }}</span></p>
        <p><span>函数代码</span><span>{{getNum}}</span></p>
        <p><span>html代码</span><span>{{'<a href="#">湖南网职</a>'}}</span></p>
        <p><span>html变量</span><span>{{html}}</span></p>
        <!-- HTML插值 -->
        <p><span>html变量</span><span v-html='html'></span></p>
        <!-- Es6模板语法 -->
        <p><span>html变量</span><span v-html='getHtml()'></span></p>
    </div>
</body>
</html>
<script src="./vue.js"></script>
<script>
   var vm=                                                                                                          new Vue({
        el:'#app',
        data(){
            return{
                myName:'老邓',
                message:'我爱你中国',
                html:'<a href="#">湖南开发大学</a>',
                fruits:[],
                user:{}
            }
        },
        methods:{
            getNum:function(){
                return "19级移动二班"
            },
            getHtml(){
                let html='<a href="#">湖南开发大学</a>'
                return `你看到的是：${html}`
            }
        }
    })
</script>